﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp5
{
    class Program : Father
    {
        static void Main(string[] args)
        {
            Father father = new Father();
            GameTop();
            father.GameChoose();
            Ready();
            aa:
            Console.WriteLine("请出拳: 1.剪刀 2.石头 3.布（输入数字代替）");
            Player player = new Player();
            player.PlayerHand(father.pname1);
            Computer computer = new Computer();
            computer.CompetreHand(father.cname1);
            Judgement judgement = new Judgement();
            Judgement.Judge1(player.Playerhand,computer.Ran,father.pname1) ;
            cc:
            Console.WriteLine("是否开始下一轮《 y / n 》");
            bb:
            char c = char.Parse(Console.ReadLine());
            if (c=='y')
            {
                goto aa;
            }
            else if (c == 'n'){
                Console.WriteLine("退出系统");
            }
            else
            {
                Console.WriteLine("仅能输入y和n,请重新输入");
                goto bb;
            }
            GameOver(father.Pname1,father.Cname1,Judgement.Pscore1, Judgement.Cscore1, Judgement.Count1,Judgement.Equal);
            goto cc;
            Console.ReadKey();
        }
        public static void GameTop()
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("-----------------欢迎进入游戏世界-----------------");
            Console.WriteLine("***************************************************");
            Console.WriteLine("*******************猜拳，开始**********************");
            Console.WriteLine("***************************************************");
            Console.WriteLine("出拳规则 ： 1.剪刀  2.石头  3.布");
        }
        public static void Ready()
        {
        aa:
            char ready = char.Parse(Console.ReadLine());
            switch (ready)
            {
                case 'y':

                    break;
                case 'n':
                    Ready();
                    break;
                default:
                    Console.WriteLine("输入异常，请重新输入");
                    goto aa;
                    break;
            }


        }
        public static void GameOver(string name,int num,int a,int b,int c,int d)
        {
            Console.WriteLine("=====================");
            Console.WriteLine((Hero)num+" vs "+ name);
            Console.WriteLine("姓名     得分");
            Console.WriteLine(name+ "     "+a);
            Console.WriteLine((Hero)num + "     "+b);
            Console.WriteLine("一共对局"+c);
            Console.WriteLine("一共和了"+d);
            if (a>b)
            {
                Console.WriteLine("结果： "+name+ "赢 "+ (Hero)num + " 笨蛋");
            }else if (a<b)
                {
                Console.WriteLine("结果： " + (Hero)num + "赢 " + name + " 笨蛋");
            }
            else
            {
                Console.WriteLine("平局，连个人机都打不赢");
            }
        }
     
    }
}